package com.bootcamp.javase.inner;

/**
 * @program: InnerCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-09-03 21:17
 **/

public class TestFather {
    public static void main(String[] args){
        Father f1 = new Son(1000);
        Father f2 = new Father();
        Son s = new Son(1000);
        f1.getI();
        s.getI();
    }
}
class Father {
    int i = 10;
    public Father() {
    }
    public int getI() {
        System.out.println(1);
        return 1;
    }
}

class Son extends Father {
    int i = 100;
    public Son(int i) {
        this.i = i;
    }
    public int getI() {
        System.out.println(2);
        return 2;
    }
}
